home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
ACORNUSERS
/
CBSA
/
EDUCATION
/
TAPEFILE
/
!TapeFile
/
cc
/
Test
Wrap
Text File
|
1998-10-24
|
1KB
|
80 lines
//-----------------------------------
// Test.c
//-----------------------------------
#include <stdio.h>
#include "swis.h"
#include "kernel.h"
#include "WimpError.h"
#include "WimpTask.h"
#include "WimpIcon.h"
class MyTask : public WimpTask
{
public:
MyTask(char *);
bool ButtonPressed();
bool load(char *, int, int);
};
MyTask::MyTask(char *name) : WimpTask(name)
{
EnableEvent(EBUT);
}
bool MyTask::ButtonPressed()
{
if (Mouse_Click.window = -2) return(TRUE);
return(FALSE);
}
bool MyTask::load(char *filename, int size, int type)
{
FILE *fp;
int c,i;
int block[128];
_kernel_swi_regs r;
i=0;
fp = fopen(filename,"r");
if (fp == NULL) my_throw("Impossible d'ouvrir le fichier");
while(( c = fgetc(fp)) != EOF)
{
if( (_kernel_osbyte(138,0,c) & 0xff0000) ) // PRM 1-168
{
while( !(_kernel_osbyte(152,0,0) & 0xff0000))
{
r.r[0] = 0xE1830; //0xE1831
r.r[1] = (int) block;
_kernel_swi(Wimp_Poll, &r,&r);
}
}
/* i++;
if (i == 255)
{
i=0;
r.r[0] = 1;
r.r[1] = 0;
r.r[2] = c;
_kernel_swi(OS_GenerateEvent, &r, &r);
while( !(_kernel_osbyte(152,0,0) & 0xff0000));
}*/
}
return FALSE;
}
int main()
{
MyTask a("CouCou");
WimpIcon b("my_sprite");
a.run();
}